package com.freight.order.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.freight.core.base.FreightBaseEntity;
import com.freight.core.common.utils.SnowFlakeUtil;
import com.freight.order.constant.OrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author huyingtai
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "order_order")
@TableName("order_order")
@ApiModel(value = "运单表")
public class OrderOrder extends FreightBaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "地址围栏 0关闭 1打开")
    private String addressFence= "1";

    @ApiModelProperty(value = "货物一级类型")
    private String goodType;

    @ApiModelProperty(value = "货物二级类型")
    private String goodSubType;

    @ApiModelProperty(value = "备注")
    private String content;

    @ApiModelProperty(value = "起始县区列表")
    private String beginAreaCode;

    @ApiModelProperty(value = "起始地址")
    private String beginAddress;

    @ApiModelProperty(value = "结束县区列表")
    private String endAreaCode;

    @ApiModelProperty(value = "结束地址")
    private String endAddress;

    @ApiModelProperty(value = "收货人名称")
    private String takeName;

    @ApiModelProperty(value = "收货联系人名称")
    private String takeContactName;

    @ApiModelProperty(value = "收货人电话")
    private String takePhone;

    @ApiModelProperty(value = "提货人单位名称")
    private String extractName;

    @ApiModelProperty(value = "提货联系人名称")
    private String extracContactName;

    @ApiModelProperty(value = "提货人电话")
    private String extractPhone;

    @ApiModelProperty(value = "预计装货经度")
    private Double beginLng;

    @ApiModelProperty(value = "预计装货纬度")
    private Double beginLat;

    @ApiModelProperty(value = "预计卸货经度")
    private Double endLng;

    @ApiModelProperty(value = "预计卸货纬度")
    private Double endLat;

    @ApiModelProperty(value = "装货电子围栏")
    private Double pretendEnclosure;

    @ApiModelProperty(value = "卸货电子围栏")
    private Double dischargeEnclosure;

    @ApiModelProperty(value = "运输时效")
    private Double prescription;

    @ApiModelProperty(value = "计价单位 1按重量 2按体积 3按件数")
    private String valuationUnit;

    @ApiModelProperty(value = "体积")
    private Double volume;

    @ApiModelProperty(value = "件数")
    private Double piece;

    @ApiModelProperty(value = "运费单价")
    private BigDecimal driverUnitPrice;

    @ApiModelProperty(value = "运费总价")
    private BigDecimal driverTotalPrice;


    //---------------货物信息-------------------------

    @ApiModelProperty(value = "运单号")
    private String orderNo = String.valueOf(SnowFlakeUtil.nextId());

    @ApiModelProperty(value = "货源id")
    private Long goodsId;

    @ApiModelProperty(value = "公司用户id")
    private Long companyUserId;

    @ApiModelProperty(value = "提货单图片id")
    private String  deliveryOrderPicId;

    @ApiModelProperty(value = "回单图片id")
    private String receiptOrderPicId;

    @ApiModelProperty(value = "配载重量")
    private Double goodWeight;

    @ApiModelProperty(value = "装车运载重量")
    private Double transGoodWeight;

    @ApiModelProperty(value = "卸车实际重量")
    private Double realGoodWeight;

    @ApiModelProperty(value = "订单状态 -1已取消 0待接单 1待装货 2运输中 3待审核  4已签收 5已完成")
    private Integer orderState = 0;

    @ApiModelProperty(value = "实际承运人拒绝原因")
    private String refuseDesc;

    @ApiModelProperty(value = "订单状态描述")
    private String orderStateDesc;

    @ApiModelProperty(value = "运单来源 1自主抢单  2平台派单")
    private String orderSource;

    @ApiModelProperty(value = "司机")
    private Long driverUserId;

    @ApiModelProperty(value = "车辆ID")
    private Long vehicleId;

}